#pragma once
#ifndef __LOG_H
#define __LOG_H

#include <iostream>
using namespace std;

#define ONLY_PRINT_LOG
#undef ONLY_PRINT_LOG

#define FORMAT(format, enter) format##enter
#define LOG_FORMAT(format, args) printf(FORMAT(format, "\n"), args)

errno_t openLogFile(FILE** pFile, const char* filename, const char* mode);
void saveLogInformation(FILE* pFile, void* log, int size);
void saveLogInformationAutoLine(FILE* pFile, void* log, int size);
void closeLogFile(FILE* pFile);

void saveBufferToFile(void* buf, const char* filename, int size);

#endif
